<template>
  <div class="container">
    <div class="containerEart">
      <p class="dialogTitle">伤亡及需紧急安置人员评估</p>
      <div class="header">
        <div class="icon">
          <svg-icon class-name="error-icon" icon-class="error" style="margin-right:10px" v-if="showIcon" />
          <span>{{ titleOption }}</span>
        </div>
      </div>
    </div>
    <el-row :gutter="30">
      <el-col :span="21">
        <p style="margin: 10px 0;"><span
            @click="handleDownloadPort({ attachId: fileNoticeId, attachName: fileNoticeName })"
            style="cursor: pointer;color:#107ce5">{{
              fileNoticeName }}</span></p>
      </el-col>
      <el-col :span="3">
        <p style="color:#107ce5;margin: 10px 0;">
          <reportResult type="3"></reportResult>
        </p>
      </el-col>
    </el-row>

    <div class="tabsBox">
      <el-row :gutter="10" class="button" v-if="!isEnd">
        <el-col :span="1.5">
          <el-button type="primary" @click="handleAssess">
            <svg-icon class-name="assess-icon" icon-class="assess" /><span style="margin-left:10px">算法评估</span>
          </el-button>
        </el-col>
        <el-col :span="1.5" v-if="activeName == 'first'">
          <el-button type="primary" @click="openUpload">
            <svg-icon class-name="upload-icon" icon-class="upload" /><span style="margin-left:10px">成果上传</span>
          </el-button>
        </el-col>
        <!-- <el-col :span="1.5">
                <el-button type="primary" @click="handleDownload">
                    <svg-icon class-name="download-icon" icon-class="download" /><span
                        style="margin-left:10px">批量下载</span>
                </el-button>
            </el-col> -->
        <!-- <el-col :span="1.5" v-if="activeName == 'second'">
          <el-button type="primary" @click="handleSubmit" :disabled="multiple">
            <svg-icon class-name="submit-icon" icon-class="submit" /><span style="margin-left:10px">提交</span>
          </el-button>
        </el-col> -->
      </el-row>
      <el-tabs v-model="activeName" type="card" class="tab" @tab-click="handleClick">
        <el-tab-pane label="中间成果" name="first">
          <el-table v-loading="loading" :data="dataList" stripe @selection-change="handleSelectionChange">
            <!-- <el-table-column type="selection" width="55" align="center" /> -->
            <el-table-column label="标题" align="center" prop="title" />
            <el-table-column label="评估内容" align="center" prop="cont" />
            <el-table-column label="生成时间" align="center" prop="date" />
            <el-table-column label="业务人员" align="center" prop="people" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template #default="scope">
                <el-button type="text" @click="handleDetil(scope.row)">查看</el-button>
                <el-button type="text" @click="handleEndResult(scope.row)" v-if="!isEnd">提交</el-button>
                <el-button type="text" @click="handledel(scope.row)" v-if="!isEnd">删除</el-button>
                <el-button type="text" @click="handleDownload(scope.row)">下载</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="最终成果" name="second" class="two">
          <el-table v-loading="loading" :data="dataLists" border @selection-change="handleSelectionChange"
            :span-method="objectSpanMethod">
            <!-- <el-table-column type="selection" width="55" align="center" prop="scAssContent" /> -->
            <el-table-column label="评估内容" align="center" prop="cont" />
            <el-table-column label="标题" align="center" prop="title" />
            <el-table-column label="生成时间" align="center" prop="date" />
            <!-- <el-table-column label="提交时间" align="center" prop="submitTime">
              <template #default="scope">
                <span v-if="scope.row.mark == '2'">{{ scope.row.submitTime }}</span>
                <span v-else></span>
              </template>
            </el-table-column> -->
            <el-table-column label="业务人员" align="center" prop="people" />
            <!-- <el-table-column label="提交状态" align="center" prop="mark">
              <template #default="scope">
                <span v-if="scope.row.mark == '2'">已提交</span>
                <span v-else>未提交</span>
              </template>
            </el-table-column> -->
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template #default="scope">
                <el-button type="text" @click="handleDetil(scope.row)">查看</el-button>
                <el-button type="text" @click="handleRemove(scope.row)" v-if="!isEnd">移除</el-button>
                <el-button type="text" @click="handleDownload(scope.row)">下载</el-button>
              </template>
            </el-table-column>
            <!-- <el-table-column label="描述" align="center" prop="scAssContent">
              <template #default="scope">
                <el-button type="text" @click="addOpenDescribe(scope.row)">编辑描述</el-button>
              </template>
            </el-table-column> -->
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </div>

    <div>
      <p style="font-size: 16px;font-weight: bold;">地震危险性评估功能说明</p>
      <ul class="ulList">
        <li>【算法评估】：分析采用公式，输入参数（如人口数量、抗震能力指标等），得出伤亡及需紧急安置人员相关指标。</li>
        <li>【成果上传】：从本地上传成果至系统中。</li>
        <li>&lt;中间成果&gt;存放通过计算或本地上传的所有成果。</li>
        <li>&lt;最终成果&gt;存放最终放入报告中的成果，报告以&lt;最终成果&gt;的内容为准进行生成。</li>
        <li>所有评估完成后，需返回评估任务界面通过【报告管理】进行报告生成、上传提交等操作。</li>
      </ul>
    </div>

    <!-- 上传对话框 -->
    <el-dialog v-model="open" width="800px" :title="title" append-to-body>
      <p></p>
      <el-form ref="uploadRef" :model="queryParams" :rules="rules" label-width="150px">
        <el-form-item label="评估内容" prop="scAssContent">
          <el-radio-group v-model="queryParams.scAssContent" @change="changeRadio" :disabled="isViewFile">
            <el-radio label="人口分布图">人口分布图</el-radio>
            <el-radio label="人员伤亡分布图">人员伤亡分布图</el-radio>
            <el-radio label="地震灾害风险等级分布图">地震灾害风险等级分布图</el-radio>
            <el-radio label="需紧急安置人员">需紧急安置人员</el-radio>
          </el-radio-group>
        </el-form-item>
        <template v-if="queryParams.scAssContent != '需紧急安置人员'">
          <el-form-item label="标题" prop="scFileTitle">
            <el-input v-model="queryParams.scFileTitle" placeholder="请输入标题" :disabled="activeName == 'second'" />
          </el-form-item>
          <el-form-item label="图片" prop="scFileId">
            <template v-if="queryParams.dataMessage && queryParams.dataMessage == '成果上传'">
              <image-upload ref="imageUpload" :limit="limit" v-model="queryParams.attach"
                :disabled="activeName == 'second'" />
            </template>
            <template v-else>
              <imgUploads ref="imageUpload" :limit="limit" v-model="queryParams.attach" disabled />
            </template>
          </el-form-item>
        </template>

        <template v-else>
          <el-form-item label="标题" prop="udTitle">
            <el-input v-model="queryParams.udTitle" placeholder="请输入标题" :disabled="activeName == 'second'" />
          </el-form-item>
          <el-form-item label="上传附件" prop="udFileId">
            <file-upload ref="udFileRef" :limit="limit" :fileType="['xlsx']" v-model="queryParams.attachment"
              @uploadFile="uploadFile" @delFile="delFile" :disabled="activeName == 'second'" />
            <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
              @click="importTemplate('需紧急安置人员模板.xlsx')">下载模板</el-link>
            <div style="width:100%">
              <el-button type="primary" :disabled="disabledUdFile || activeName == 'second'" @click="createExcle">生成表格
              </el-button>
              <el-table v-loading="loading1" :data="tableList" stripe v-if="showExcle" style="margin:20px 0">
                <template v-for="(item, index) in tableTitle" :key="index">
                  <el-table-column :label="item.label" align="center" :prop="item.prop" />
                </template>
              </el-table>
            </div>
          </el-form-item>
        </template>
        <el-form-item label="数据信息" v-if="isViewFile">
          <span v-html="queryParams.dataMessage"></span>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="handleUpload" v-if="activeName == 'first'">确定</el-button>
          <el-button @click="cancelUpload">取消</el-button>
        </div>
      </template>
    </el-dialog>

    <!-- 编辑描述 -->
    <el-dialog v-model="openDescribe" width="800px" title="编辑描述">
      <p style="margin-top:20px"></p>
      <el-button type="primary" @click="addDescribe" v-if="describe.length < 4" style="margin-bottom:10px">
        <svg-icon class-name="upload-icon" icon-class="upload" /><span style="margin-left:10px">添加描述</span>
      </el-button>
      <el-form ref="describeRef" :model="describe" :rules="rules" label-width="150px" v-if="describe.length > 0">
        <el-row>
          <template v-for="(item, index) in describe" :key="index">
            <el-col :span="22">
              <el-form-item label="描述" :prop="index + '.describe'" :rules="rules.describe">
                <el-input v-model="item.describe" type="textarea" maxlength="500" show-word-limit
                  :autosize="{ minRows: 5, maxRows: 5 }" placeholder="请输入描述" />
              </el-form-item>
            </el-col>
            <el-col :span="2">
              <el-icon color="red" :size="25" style="margin:20px" @click="remove(index)">
                <Remove />
              </el-icon>
            </el-col>
          </template>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="handleDescribe">确定</el-button>
          <el-button @click="openDescribe = false">取消</el-button>
        </div>
      </template>
    </el-dialog>

    <!-- 商会对话框 -->
    <el-dialog v-model="showOption" width="400px" title="震情趋势" :close-on-click-modal="false" append-to-body>
      <p class="worrning">震情趋势已发生变化，请注意！</p>
      <el-radio v-model="radioOption" label="true" style="margin-left:10px">今日不再提醒</el-radio>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" :disabled="!radioOption" @click="ok">确定</el-button>
          <el-button @click="cancelOption">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup name="population">
import { getImport } from "@/api/business/activities"
import { listPopulation, getPopulation, uploadPopulation, updatePopulation, delPopulation, listPopulations, firstSubmitCasualties, titleCheck, updataDescribe, removeDisasterAss, secondSubmitDisasterAss, getPath, isCoverData, coverData } from "@/api/assess/population";
import { getUrgency, uploadUrgency, updateUrgency, delUrgency, createUrgencyExcle, firstSubmitDisasterAss, isCover, isCoverSubmit,titleCheck1 } from "@/api/assess/urgency";
import { setcookieTimeFun, getCookieFun } from "@/utils/popout";
import { dataMethod } from '@/utils/spanTable.js'
import { isArray } from "@vue/shared";
import imgUploads from '@/components/ImageUploadNew/index.vue'
import reportResult from "@/components/reportResult/index.vue"

const { proxy } = getCurrentInstance();
const route = useRoute();
const router = useRouter();
const showIcon = ref(false);
const titleOption = ref();
const loading = ref(false);
const showOption = ref(false);
const open = ref(false);
const radioOption = ref(false);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const title = ref("");
const id = ref();
const limit = ref(1)
const isViewFile = ref(false);
const scRelation = ref();
const activeName = ref('first');
const spanObj = ref();
const openDescribe = ref(false);
const updateIds = ref([]);
const uploadIds = ref([]);
const oldTitle = ref('');
const flagSubmit = ref(true);
const flagMessage = ref([]);
const isEnd = ref(true);
// 文件通知 信息
const fileNoticeName = ref();
const fileNoticeId = ref();
const titleName = (rule, value, callback) => {
  if (!value) {
    callback(new Error('请输入标题'))
  } else if (value && oldTitle.value && title.value == '查看' && oldTitle.value == value) {
    callback()
  } else if (value) {
    const parmas = { scRelation: route.query.id, scFileTitle: value ,scAssContent:queryParams.value.scAssContent}
    titleCheck(parmas).then(res => {
      if (!res.data) {
        callback()
      } else {
        callback(new Error("该标题已存在，请重新输入"))
      }
    }).catch(_ => {
      callback(new Error(_.message))
    })
  }
}

const titleName1 = (rule, value, callback) => {
  if (!value) {
    callback(new Error('请输入标题'))
  } else if (value && oldTitle.value && title.value == '查看' && oldTitle.value == value) {
    callback()
  } else if (value) {
    const parmas = { udRelation: route.query.id, udTitle: value ,udContent:queryParams.value.scAssContent}
    titleCheck1(parmas).then(res => {
      if (!res.data) {
        callback()
      } else {
        callback(new Error("该标题已存在，请重新输入"))
      }
    }).catch(_ => {
      callback(new Error(_.message))
    })
  }
}
const data = reactive({
  queryParams: {
    scFileId: '',
    attach: [],
    scFileTitle: '',
    scAssContent: '人口分布图',
    dataMessage: '成果上传'
  },
  dataList: [],
  dataLists: [],
  describe: [],
  rules: {
    scAssContent: [{ required: true, message: "评估内容不能为空", trigger: "blur" }],
    scFileId: [{ required: true, message: "图片不能为空", trigger: "blur" }],
    scFileTitle: [{ required: true, validator: titleName, trigger: "blur" }],
    describe: [{ required: true, message: "描述不能为空", trigger: "blur" }],
    udFileId: [{ required: true, message: "附件不能为空", trigger: "blur" }],
    udTitle: [{ required: true, validator: titleName1, trigger: "blur" }],
  }
})
const { queryParams, dataList, dataLists, describe, rules } = toRefs(data)

const handleClick = (tab, event) => {
  if (tab.props.name == "first") {
    getList();
  } else {
    getLists();
  }
}

// 需紧急
// 模板下载
const udRelation = ref();
const disabledUdFile = ref(true);
const showExcle = ref(false);
const tableList = ref([]);
const tableTitle = ref([]);
const loading1 = ref(false);

function importTemplate(name) {
  proxy.download("/fxfzaqbz/data/downloadExcel", {
    fileName: name
  }, name);
};

// 生成表格
function createExcle() {
  loading1.value = true;
  createUrgencyExcle({ udFileId: queryParams.value.udFileId }).then(res => {
    showExcle.value = true;
    tableTitle.value = [];
    Object.entries(res.data[0]).forEach(item => {
      tableTitle.value.push({ label: item[1], prop: item[0] })
    })
    tableList.value = res.data.splice('1');
    loading1.value = false;
  })
}

// 上传成功
function uploadFile(val) {
  queryParams.value.udFileId = val;
  disabledUdFile.value = false;
  tableTitle.value = [];
}

// 删除成功
function delFile(val) {
  queryParams.value.udFileId = val;
  disabledUdFile.value = true;
  showExcle.value = false;
}

function changeRadio(value) {
  queryParams.value = {
    scFileId: '',
    attach: [],
    scFileTitle: '',
    scAssContent: value,
    dataMessage: '成果上传'
  }
  proxy.resetForm("uploadRef");
}

/** 多选框选中数据 */
function handleSelectionChange(selection) {
  ids.value = selection.map((item) => item.scId);
  flagMessage.value = [];
  flagSubmit.value = true;
  if (activeName.value == 'second') {
    selection.forEach((item) => {
      if (!item.describe) {
        flagSubmit.value = false;
        flagMessage.value.push(item.scAssContent)
      }
    })
    uploadIds.value = [];
    let content = [];
    selection.forEach(item => {
      content.push(item.scAssContent);
    })
    dataLists.value.forEach(item => {
      content.forEach(i => {
        if (item.scAssContent == i) {
          uploadIds.value.push(item.scId)
        }
      })
    })
  }
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

// 合并列
function objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  //判断合并列
  const _row = spanObj.value[column.property] ? spanObj.value[column.property][rowIndex] : 1;
  const _col = _row > 0 ? 1 : 0;
  return {
    rowspan: _row,
    colspan: _col,
  }
}

/** 获取列表操作 */
function getList() {
  scRelation.value = route.query.id
  id.value = route.query.id;
  loading.value = true;
  listPopulation(id.value).then((response) => {
    dataList.value = response.data;
    loading.value = false;
  });
}

/** 获取列表操作 */
function getLists() {
  scRelation.value = route.query.id
  id.value = route.query.id;
  loading.value = true;
  listPopulations(id.value).then((response) => {
    dataLists.value = response.data;
    spanObj.value = dataMethod(dataLists.value, ['scAssContent']);
    loading.value = false;
  });
}

// 打开成果上传开关
function openUpload() {
  reset();
  isViewFile.value = false;
  title.value = "上传"
  open.value = true;
}

// 重置上传
function reset() {
  queryParams.value = {
    scFileId: '',
    attach: [],
    scFileTitle: '',
    scAssContent: '人口分布图',
    dataMessage: '成果上传'
  }
  proxy.resetForm("uploadRef");
}

function upload1() {
  uploadUrgency({ ...queryParams.value, udRelation: route.query.id,udContent:'需紧急安置人员' }).then(response => {
    proxy.$modal.msgSuccess("上传成功");
    open.value = false;
    getList();
  }).catch(() => { });
}

// 成果上传
function handleUpload() {
  if (queryParams.value.scAssContent == '需紧急安置人员') {
    if (tableTitle.value.length == 0) {
      proxy.$modal.msgWarning("表格未生成");
    } else {
      if (title.value == '上传') {
        upload1();
      } else if (title.value == '查看') {
        updateUrgency(queryParams.value).then(response => {
          proxy.$modal.msgSuccess("保存成功");
          open.value = false;
          getList();
        });
      }
    }
  } else {
    const fileList = JSON.parse(JSON.stringify(proxy.$refs["imageUpload"].fileList));
    const attachIds = [];
    for (var i = 0; i < fileList.length; i++) {
      attachIds.push(fileList[i].attachId)
    }
    queryParams.value.scFileId = attachIds.join(",");
    proxy.$refs["uploadRef"].validate(valid => {
      if (valid) {
        if (title.value == '上传') {
          upload();
        } else if (title.value == '查看') {
          updatePopulation({ ...queryParams.value, scRelation: route.query.id }).then(response => {
            proxy.$modal.msgSuccess("保存成功");
            open.value = false;
            getList();
          });
        }
      }
    });
  }
}
function upload() {
  uploadPopulation({ ...queryParams.value, scRelation: route.query.id }).then(response => {
    proxy.$modal.msgSuccess("上传成功");
    open.value = false;
    getList();
  }).catch(() => { });
}

function getDetail(row) {
  tableList.value = [];
  tableTitle.value = [];
  getPopulation({ id: row.id, cont: row.cont }).then(response => {
    if (row.cont == '需紧急安置人员') {

      queryParams.value = response.data.urgencysettleData;
      queryParams.value.scAssContent = response.data.urgencysettleData.udContent
      queryParams.value.attachment = [response.data.attach];
      Object.entries(response.data.forms[0]).forEach(item => {
        tableTitle.value.push({ label: item[1], prop: item[0] })
      })
      tableList.value = response.data.forms.splice('1');
      disabledUdFile.value = false;
      showExcle.value = true;
      isViewFile.value = true;
      title.value = "查看"
      open.value = true;
    } else {
      queryParams.value = response.data.casualtiesEntity;
      oldTitle.value = response.data.casualtiesEntity.scFileTitle;
      queryParams.value.attach = response.data.attach ? [response.data.attach] : [];
      isViewFile.value = true;
      title.value = "查看"
      open.value = true;
    }
  })
}

/** 查看方法*/
function handleDetil(row) {
  title.value = '查看';
  reset();
  getDetail(row)
}

// 取消成果上传
function cancelUpload() {
  reset();
  open.value = false;
}
// 提交最终成果
function handleEndResult(row) {
  if(row.cont=='需紧急安置人员'){
    isCoverData(id.value).then(res=>{
      if(res.data){
        proxy.$modal.confirm('该成果已存在,是否覆盖').then(function () {
          return coverData({iaId:id.value,id:row.id});
        }).then(() => {
          proxy.$modal.msgSuccess("提交成功");
          getList();
        }).catch(() => { });
      }else{
        firstSubmitCasualties({ id: row.id, cont: row.cont }).then(res => {
          getList();
          proxy.$modal.msgSuccess("提交成功");
        })
      }
    })
  }else{
    firstSubmitCasualties({ id: row.id, cont: row.cont }).then(res => {
        getList();
        proxy.$modal.msgSuccess("提交成功");
      })
  }
}
// 移除
function handleRemove(row) {
  removeDisasterAss({ id: row.id, cont: row.cont }).then(res => {
    getLists();
    proxy.$modal.msgSuccess("移除成功");
  })
}
/** 删除按钮操作 */
function handledel(row) {
  const id = row.id;
  proxy.$modal.confirm('是否确认删除' + row.cont + '的数据项？').then(function () {
    return delPopulation({ id: id, cont: row.cont });
  }).then(() => {
    getList();
    proxy.$modal.msgSuccess("删除成功");
  }).catch(() => { });
}


// 编辑描述
function addOpenDescribe(row) {
  describe.value = [];
  getPopulation(row.scId).then(response => {
    console.log(response.data.casualtiesEntity);
    if (isArray(response.data.casualtiesEntity.describe)) {
      response.data.casualtiesEntity.describe.forEach(item => {
        describe.value.push({ describe: item });
      });
    } else {
      describe.value = [];
    }

    openDescribe.value = true;
    proxy.resetForm("describeRef");
  })
  updateIds.value = [];
  dataLists.value.forEach(item => {
    if (item.scAssContent == row.scAssContent) {
      updateIds.value.push(item.scId)
    }
  })
}
// 删除描述
function remove(index) {
  describe.value.splice(index, 1)
}
// 添加
function addDescribe() {
  describe.value.push({ describe: '' });
}
function handleDescribe() {
  if (describe.value.length == 0) {
    const query = { ids: updateIds.value, disasterAss: null };
    updataDescribe(query).then(res => {
      getLists();
      openDescribe.value = false;
      proxy.$modal.msgSuccess("编辑成功");
    })
  } else {
    proxy.$refs["describeRef"].validate(valid => {
      if (valid) {
        describe.value = describe.value.map(item => {
          return item.describe
        })
        const query = { ids: updateIds.value, disasterAss: describe.value };
        updataDescribe(query).then(res => {
          getLists();
          openDescribe.value = false;
          proxy.$modal.msgSuccess("编辑成功");
        })
      }
    });
  }
}
// 评估
function handleAssess() {
  router.push({
    path: "/assess/populationMap",
    query: {
      id: route.query.id
    }
  })
}

// 下载
function handleDownload(row) {
  getPath({ id: row.id, cont: row.cont }).then(res => {
    console.log(res.data);
    var query = {
      attachId: res.data.attachId,
      name: res.data.attachName
    }
    location.href = import.meta.env.VITE_APP_BASE_API + "/attachment/downLoadFile?attachId=" + encodeURIComponent(query.attachId);
  })
}

// 下载文件
function handleDownloadPort(row) {
  var query = {
    attachId: row.attachId,
    name: row.attachName
  }
  location.href = import.meta.env.VITE_APP_BASE_API + "/attachment/downLoadFile?attachId=" + encodeURIComponent(query.attachId);
};


// 提交
function handleSubmit() {
  if (!flagSubmit.value) {
    proxy.$modal.confirm(flagMessage.value.join(',') + '的描述未添加,是否提交').then(function () {
      return secondSubmitDisasterAss(uploadIds.value);
    }).then(() => {
      getLists();
      proxy.$modal.msgSuccess("提交成功");
    }).catch(() => { });
  } else {
    secondSubmitDisasterAss(uploadIds.value).then(res => {
      getLists();
      proxy.$modal.msgSuccess("提交成功");
    })
  }
}

// 监听单选按钮
watch(showIcon, (val) => {
  console.log(val);
  showOption.value = val;
  if (showOption.value) {
    getTimeSetCookieFun(`populationCookie${route.query.id}`)
  }
})

// 获取日期时间
function getTimeSetCookieFun(name) {
  var day = getCookieFun(name) == '' ? '' : getCookieFun(name);
  if (day == '') {
    // console.log('没有cookie,说明过期或者还没有存')
    showOption.value = true;
  } else {
    var newTime = new Date().getDate();
    if (newTime > day) {
      // console.log('我是新的一天,我要弹窗')
      showOption.value = true;
    } else {
      showOption.value = false;
    }
  }
}
// 取消商会意见
function cancelOption() {
  showOption.value = false;
}
// // 确认不再提示
function ok() {
  var newTime = new Date().getDate();
  setcookieTimeFun(`populationCookie${route.query.id}`, newTime, 1)
  showOption.value = false;
}
function getOpinion() {
  getImport(route.query.id).then(res => {
    titleOption.value = res.data.importantActivity.iaOpinion;
    showIcon.value = Boolean(Number(res.data.importantActivity.iaOpinionStatus));
    fileNoticeName.value = res.data.list[0].attachName;
    fileNoticeId.value = res.data.list[0].attachId;
    isEnd.value = res.data.importantActivity.iaActivityStatus==1;
  })
}
getOpinion();
getList();
</script>
<style lang="scss" scoped>
.container {
  margin: 0px auto;
  height: 100%;
  width: 1200px;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;

  .worrning {
    width: 340px;
    height: 110px;
    color: #3d4a5d;
    font-size: 18px;
    line-height: 26px;
    background: #f5f9fe;
    margin: 30px auto 10px;
    padding: 15px;
  }

  .header {
    padding: 10px 0px;

    .title {
      font-size: 18px;
      font-weight: bold;
    }

    div {
      height: 60px;
      line-height: 60px;
      margin-top: 10px;

      &.icon {
        padding: 0 20px;
        background: #f5f9fe;
      }
    }
  }

  .tabsBox {
    padding: 0;
    margin: 0;
    position: relative;
  }

  .button {
    position: absolute;
    top: 5px;
    left: 205px;
    z-index: 200;
  }

  .two {
    :deep(.el-table) td.el-table__cell {
      border-bottom: 1px solid #ebeef5 !important;
      border-right: 1px solid #ebeef5 !important;
    }
  }
}

.ulList {
  li {
    line-height: 30px;
  }

  li::marker {
    color: #F56C6C;
    font-size: 25px;
  }
}
</style>
  